﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace EbbinghausWord.BLL
{
    /// <summary>
    /// 用户配置管理类
    /// </summary>
    public static class SystemConfig
    {
        #region private field

        //private static readonly string _version = "1.2";

        private static readonly int _initWordCount = 20;
        private static readonly int _minQueueWordCount = 10;
        private static readonly int _increaseQueueWordCount = 10;

        private static readonly string _userWorkBookFileName = "userwordbook.dat";
        private static readonly string _backupFileName = "backup.dat";
        private static readonly string _queueFileName = "queue.dat";
        private static readonly string _userConfigFileName = "userconfig.dat";

        private static readonly string _voiceFilePath = @"/voice";

        /// <summary>
        /// 遗忘曲线时间点
        /// </summary>
        private static readonly List<TimeSpan> _forgetTimePoint = new List<TimeSpan>()
                                                                      {
                                                                          TimeSpan.FromMinutes(0),
                                                                          TimeSpan.FromMinutes(10),
                                                                          TimeSpan.FromHours(12),
                                                                          TimeSpan.FromHours(23),
                                                                          TimeSpan.FromDays(3),
                                                                          TimeSpan.FromDays(5),
                                                                          TimeSpan.FromDays(9),
                                                                          TimeSpan.FromDays(13),
                                                                          TimeSpan.FromDays(18),
                                                                          TimeSpan.FromDays(10000),
                                                                      };

        #endregion

        #region public property

        /// <summary>
        /// 备份文件路径
        /// </summary>
        public static string BackupFileName
        {
            get { return _backupFileName; }
        }

        /// <summary>
        /// 用户单词本路径
        /// </summary>
        public static string UserWordkBookFileName
        {
            get { return _userWorkBookFileName; }
        }

        /// <summary>
        /// 学习曲线的时间点
        /// </summary>
        public static List<TimeSpan> ForgetTimePoint
        {
            get { return _forgetTimePoint; }
        }

        /// <summary>
        /// 获得彻底记住单词的 记忆等级，这里采用了记忆等级来表示单词是否彻底被记住
        /// </summary>
        public static int AchievementRememberLevel
        {
            get
            {
                return _forgetTimePoint.Count - 2;
            }
        }

        /// <summary>
        /// 队列初始单词数
        /// </summary>
        public static int InitWordCount { get { return _initWordCount; } }

        /// <summary>
        /// 最小队列单词数
        /// </summary>
        public static int MinQueueWordCount { get { return _minQueueWordCount; } }

        /// <summary>
        /// 每次增加的单词数
        /// </summary>
        public static int IncreaseQueueWordCount { get { return _increaseQueueWordCount; } }

        /// <summary>
        /// 队列序列化文件名
        /// </summary>
        public static string QueueFileName { get { return _queueFileName; } }

        /// <summary>
        /// 用户配置文件名称
        /// </summary>
        public static string UserConfigFileName { get { return _userConfigFileName; } }

        /// <summary>
        /// 应用程序版本号
        /// </summary>
        public static string Version
        {
            get { return System.Reflection.Assembly.GetExecutingAssembly().FullName.Split(',')[1].Substring(9); }
        }

        /// <summary>
        /// 单词发音 文件的路径
        /// </summary>
        public static string VoiceFilePath
        {
            get { return _voiceFilePath; }
        }

        #endregion

    }
}
